/**
* @Description: WoShop商城
* @Author: Parker
* @Copyright: 武汉一一零七科技有限公司©版权所有
* @Link: www.wo-shop.net
* @Contact: QQ:2487937004
*/
<script>
	// #ifdef APP-PLUS
	import APPUpdate from '@/uni_modules/zhouWei-APPUpdate/js_sdk/appUpdate';
	// #endif
	export default {
		data() {
			return {
				msg: {}
			}
		},
		onLaunch() {

			this.$store.dispatch("getShowConfig");
			// #ifdef APP-PLUS
			APPUpdate();
			// #endif

			const token = uni.getStorageSync('token');
			if (token) {
				this.$store.commit('loginStatus', true)
				// this.im();
			}else{
				uni.closeSocket({
					success() {
						console.log('socket关闭成功');
					},
					fail(res) {
						console.log(res);
					}
				})
			}
			// #ifdef APP-PLUS
			var info = plus.push.getClientInfo();
			var options = {
				cover: true
			};
			plus.push.setAutoNotification(true);
			plus.push.addEventListener(
				"click",
				function(msg) {
					uni.navigateTo({
						url: "/pagesB/message/message"
					});
				},
				false
			);
			//监听在线消息事件
			plus.push.addEventListener(
				"receive",
				function(msg) {
					if (msg.payload !== "LocalMSG") {
						plus.push.createMessage(msg.content, "LocalMSG", options);
					}
				},
				false
			);
			// #endif
		},
		methods: {

		},
		onError() {
			console.log('监听到error')
		},
		onUnhandledRejection() {
			console.log('监听Promise 拒绝事件')
		},
		onPageNotFound() {
			this.$toast('当前页面不存在')
		}
	};
</script>
<style lang="less">
	@import "/static/css/global.css";
	/* #ifndef APP-NVUE */
	@import "./static/css/index.less";
	@import "graceUI/graceUI.css";
	@import "/static/css/iconfont.css";

	/deep/ .u-subsection .u-item-text {
		justify-content: center;
	}

	/deep/::-webkit-scrollbar {
		display: none;
		width: 0 !important;
		height: 0 !important;
		-webkit-appearance: none;
		background: transparent;
	}


	uni-toast {
		z-index: 100000;
	}

	.select.active {
		background-image: url("/static/images/choosed-red.png");
	}

	.underLine.active {
		background: rgba(250, 62, 63, 1);
	}

	.span weixin-parse-template {
		margin: 0 !important;
	}

	page {
		background: #f4f4f4;
	}

	/* #endif */
	/* #ifdef H5 */
	uni-page-head .uni-page-head__title {
		font-weight: normal;
		color: rgb(96, 98, 102);
	}
	/* #endif */


</style>
